<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>机构信息列表</title>
    <%--引入bootstrap样式--%>
    <link href="../css/bootstrap.min.css" rel="stylesheet">
    <link href="../css/branch.css" rel="stylesheet">
    <script src="../js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
    <script src="../js/jquery-3.6.0.js" type="text/javascript" charset="utf-8"></script>
    <script src="../js/branch.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<!-- 向后台请求机构信息数据 -->
<jsp:include page="/branchServlet"></jsp:include>
<div class="container">
    <div class="row">
        <div class="col-sm-10">
            <div class="heading"><strong>机构详情列表</strong></div>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-10">
            <a class="btn btn-primary" href="addBranch.jsp" role="button">新增机构</a>
        </div>
    </div>
    <table class="table table-hover">
        <thead>
        <tr>
            <th scope="col">机构编号</th>
            <th scope="col">机构名称</th>
            <th scope="col">备注</th>
            <th scope="col">操作1</th>
            <th scope="col">操作2</th>
        </tr>
        </thead>
        <tbody>
        <c:forEach items="${branchList}" var="item">
            <tr>
                <th scope="row">${item.branchId}</th>
                <td class="col-sm-2">${item.branchName}</td>
                <td class="col-sm-6">${item.remark}</td>

                <td><a class="btn btn-outline-primary" role="button" href="${pageContext.request.contextPath}/branchServlet?branchId=${item.branchId}">编辑</a></td>
                <td><button type="button" class="btn btn-outline-danger branch-delete" onclick="javascript:delBranch(${item.branchId});">删除</button></td>
            </tr>
        </c:forEach>
        </tbody>
    </table>
</div>
</body>
</html>
